package com.qf.t1;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

/*
杨威
2021/9/3
17:52
*/
public class TestDelete {
    public static void main(String[] args) throws  Exception{
        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/schools?useSSL=false&characterEncoding=utf-8", "root", "1234");
        Statement statement = connection.createStatement();
        int i = statement.executeUpdate("delete from student where stu_id=21;");
        if(i>0){
            System.out.println("删除成功");
        }else{
            System.out.println("删除失败");
        }
        statement.close();
        connection.close();

    }
}
